#include "mainwindow.h"
#include <QApplication>
#include <QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QSlider>
#include <QtWidgets/QSpinBox>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QWidget * window = new QWidget();
    window->setWindowTitle("Enter you name");

    QSpinBox * spinBox =new QSpinBox();
    QSlider * slider = new QSlider();
    spinBox->setRange(0,130);
    slider->setRange(0,130);

    QObject::connect(spinBox,SIGNAL(valueChanged(int)),slider,SLOT(setValue(int)));
    QObject::connect(slider,SIGNAL(valueChanged(int)),spinBox,SLOT(setValue(int)));
    spinBox->setValue(35);
    QHBoxLayout * layout = new QHBoxLayout();
    layout->addWidget(spinBox);
    layout->addWidget(slider);
    window->setLayout(layout);
    window->show();
    return app.exec();
}


int main_1(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton * theQPushButton =new QPushButton("push me");
    QObject::connect(theQPushButton,SIGNAL(clicked()),&app,SLOT(quit()));
    theQPushButton->show();
    return app.exec();
}
